import service from '@/utils/crmRequest'

export default () => ({
  //产品下拉
  BUSINESSAGREEMENT_PRODUCT: (val) => {
    return service({
      url: `/api/seller/factor/product-list?from=${val}`,
      method: 'get',
    })
  },

  //列表
  BUSINESSAGREEMENT_LIST: (data) => {
    return service({
      url: `/api/seller/factor/list`,
      method: 'post',
      data
    })
  },

  //列表---删除
  BUSINESSAGREEMENT_DELETE: (id) => {
    return service({
      url: `/api/seller/factor/delete?id=${id}`,
      method: 'delete',
    })
  },

  //列表---作废
  BUSINESSAGREEMENT_BAN: (id,val) => {
    return service({
      url: `/api/seller/factor/ban?id=${id}&banReason=${val}`,
      method: 'PUT',
    })
  },

  //创建
  BUSINESSAGREEMENT_CREATE: (data) => {
    return service({
      url: `/api/seller/factor/create`,
      method: 'post',
      data
    })
  },

  //更新
  BUSINESSAGREEMENT_UPDATE: (data) => {
    return service({
      url: `/api/seller/factor/update`,
      method: 'put',
      data
    })
  },

  //变更新
  BUSINESSAGREEMENT_CHANGE: (data) => {
    return service({
      url: `/api/seller/factor/change`,
      method: 'put',
      data
    })
  },

  //详情
  BUSINESSAGREEMENT_DETAILS: (id) => {
    return service({
      url: `/api/seller/factor/detail?id=${id}`,
      method: 'get',
    })
  },

  //商销客户名称模糊查询
  BUSINESSAGREEMENT_SHANGPIN_LIST: (keyWord) => {
    return service({
      url: `/api/seller/list?keyWord=${keyWord}`,
      method: 'get',
    })
  },

  //商销客户新建产品
  BUSINESSAGREEMENT_NEW_PRODUCT: (keyWord) => {
    return service({
      url: `/api/product/getList?keyWord=${keyWord}&from=1&planType=4`,
      method: 'get',
    })
  },

  //商销客户分配产品
  BUSINESSAGREEMENT_TASK_PRODUCT: (data) => {
    return service({
      url: `/api/plan/detail/list/product/down/list `,
      method: 'post',
      data
    })
  },

})